﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using tracker.Models.BLL;
using tracker.Models;

namespace tracker.Controllers
{
    public class LoginController : Controller
    {
        //
        // GET: /Login/

        public ActionResult Index()
        {
            if (new EUserLoginBLL().checkSession() == 1)
            {
                return Redirect("/Home");
            }
            return View();
        }
        public string login(string userName, string passWord, string timeZone)
        {
            EUserLoginBLL user = new EUserLoginBLL();
            return user.login(userName, passWord).ToString();
        }
        [CallAjaxFilter]
        public int logout()
        {
            HttpContext.Session[Common.USER] = null;
            return 1;
        }
        public string test()
        {
            String pwd = "w3s";
            return Utilities.GetMD5Hash(pwd);
        }
    }
}
